Energy dispersive x-ray (EDX) spectrometers use electronics to detect and measure the pulse arising from the arrival of a single photon in a detector and thus determine the energy of the photon and increment the corresponding energy “bin” in a histogram of counts representing the digitized energy spectrum. At high photon rates, it is possible for a second photon to arrive while the first is being measured and this gives an erroneous result due to “pulse pile-up”. Most systems therefore include pile-up inspection circuitry to detect and veto such false measurements. The circuitry typically makes a correction by extending the acquisition time beyond the specified “live time” to compensate for the discarded measurements. The two contributing photons are effectively lost as if the acquisition period was “dead” for a short time, but rejecting such bad measurements will eliminate the false counts that would otherwise appear at the wrong energy in the spectrum. However, pile-up rejection circuitry is not perfect and if a photon of energy E2 arrives within the “blind time” of the pile-up inspector following an earlier photon of energy E1 then the resulting corrupted measurement will appear near the energy E1+E2. Thus, when two large peaks are visible in the x-ray spectrum, a spurious “sum peak” may also appear at the sum of the two peak energies. An early publication [P J Statham (1977), “Pile-up rejection: limitations and corrections for residual errors in energy dispersive spectrometers”, X-Ray Spectrometry, 6, 94-103] suggests that, to first order, parent peaks at E1 and E2 give rise to a sum peak at E1+E2 with area given by the following equation:ASum=A1·A2·(T12+T21)/L  (1)
Where L is the “live time” for the spectrum (the acquisition time corrected for electronic dead time periods), ASum is the area in counts of the sum peak, A1, A2 are the areas of the parent peaks and T12 is the minimum time for the pile-up rejection system to be able to resolve a photon of energy E1 followed by a photon of energy E2. It follows that T21 relates to the minimum time for an E2 energy photon to be resolved following an E1 photon.
For accurate element identification, sum peaks have to be eliminated because energy sums can occur close to the energies of other element peaks and give rise to false designations. For example, C Kα+C Kα appears near O Kα; O Kα+O Kα appears near Na Kα, and Si Kα+Ca Kα appears near Cr Kα. When pile-up occurs, counts that should have appeared in an elemental peak now appear elsewhere in the spectrum so there are also pile-up losses that affect relative peak intensities and the accuracy of quantitative analysis. Besides sum peaks and counting losses, the spectrum shape may be distorted by “pile-up continuum”. For example, near coincident arrival of characteristic photons with bremsstrahlung photons will produce an extension of the bremsstrahlung continuum above the Duanne-Hunt Limit (DHL) which would normally represent the highest possible x-ray energy in the spectrum. An additional complication is that when two pulses are not resolved, the magnitude of the measurement may be slightly less than E1+E2 because the time of arrival of the E2 photon can be anywhere between 0 and T12.
A procedure for correcting a spectrum for pile-up has been described previously [P. J. Statham (2006) Microchim. Acta 155, 289-294]. This extends the principle of equation (1) to cover individual channels in a digitized energy spectrum, rather than just peaks. Instead of using whole peak areas, equation (1) is evaluated at each channel, i, equivalent to a first photon Ei, for all possible second photons Ej (recorded in channel j) to find what contribution will occur in energy channel i+j using the contents of the respective spectrum channels. T(i,j) is the effective resolving time for a photon corresponding to energy i followed by energy j so that if Ej arrives within this blind period, pile-up will occur and produce a sum event. The contribution from these sum events can then be subtracted from the original spectrum. As described in Statham (1977), the fraction of pulses in each channel that are “lost” by pile-up to higher spectrum energies can also be calculated and this should be performed before equation (1) is applied. A lost counts factor l(i) can be estimated as exp(Σk a[k]·T(i,k)/L). Here, a(i) is the number of counts in channel i in the original spectrum, and al(i)=a(i)·l(i) is the counts after correction for pile up losses that more accurately reflects the incoming spectrum. Thus, in the overall correction, sum peaks and pile-up continua are removed and peaks are restored to compensate for pile-up losses. Application of equation (1) over all channels effectively produces a sum peak that has a width equal to the quadrature sum of the widths of the parent peaks contributing to the sum. However, the true width of the sum peak is the quadrature sum of the detector contributions at the two energies in quadrature with the electronic noise width. This slight overestimate of width can be corrected by a small resolution enhancement prior to calculation. As described by Statham (2006), the determination of the resolving time T12 as a function of the two photon energies E1, E2 requires consideration of the detailed design of the pile-up inspector and the electronic noise in the system.
FIG. 4 in Statham (2006) shows a measurement channel (signal input) where the step height is proportional to photon energy. Measurement of the step height is performed by subtracting the average of the signal before and after the step. There are 3 pile-up inspection channels shown in FIG. 4, each with different time constants and therefore different noise contributions. The faster resolving time channel is noisier so it is not always easy to see the arrival of “steps”. The slightly slower resolving “medium” channel cannot resolve steps so closely together, but has lower noise so it does see the arrival of the second step. Since this would be within the measurement period, the measurement is vetoed and does not appear in the spectrum. A correction is made to extend the acquisition time to compensate for the time that did not yield a measurement. Not all corrupted measurements will be detected and the average “blind period” T12 following an event E1 where a second event E2 will not be recognized by the pile-up inspection system can be calculated from the design of the pile-up inspection system and the noise characteristics of the spectrometer.
An algorithm to perform this known process of pile up correction is as follows:
Algorithm 1: Prior art single pulse “pile-up correction”1.Increase count magnitude in each spectrum channel a[i] tocompensate for lost counts: al[i] = a[i] * l(i)2.For each channel i  For each channel j    Add contribution al[i] * ( a[j] / L) * T(i,j) into    channel sp[i+j]3.Subtract sum event spectrum sp[i] from a[i] and increase magnitudeof result to compensate for lost counts:corrected spectrum, ac[i] = (a[i] − sp[i]) * l(i)
It should be noted that the calculation of al[i] in step 1 is used to ensure a more accurate calculation of the “sum event” spectrum in step 2. Note also that a[j] is used in step 2, rather than the loss-corrected value al[i], because for single pile-up, the second photon must not be followed by a further photon within its “blind” period. This condition is basically the same as that required for a count to appear in a[i] rather than being pushed to a higher channel number by pile-up. In the third step the “sum event” spectrum (which essentially contains only sum event peaks) is subtracted from the original spectrum a[i]. Thus the first instance of considering lost counts in step (1) is to maximize the accuracy of the sum event spectrum in step (2), whereas the second instance of considering lost counts in step (3) is to most accurately reconstruct the “real” spectrum as was incident upon the detector. Furthermore, T(i,j) is an approximation to (1−exp(−NT·T(i·j)))/NT, where NT is the total spectrum count rate, that can be improved at some cost to computation time if desired.
An example of the use of Algorithm 1 is shown in FIGS. 1a, 1b and 1c for a spectrum from a sample of Al2O3 excited by a 20 keV electron beam. The uncorrected spectrum corresponding to a 20000 counts per second (cps) acquisition and having a full scale ordinate of 12123 counts, is shown in FIG. 1a, with an abscissa of kiloelectron Volts (keV). A 20 kcps acquisition rate is a modest count rate by state of the art standards. Spectral peaks for Aluminium and Oxygen are labelled in FIG. 1a. A scaled version of the spectrum is shown in FIG. 1b with an ordinate full scale of 573 counts. At this scale, the sum peaks for Al+O and Al+Al are visible and are also labelled in FIG. 1b. These energies are close to the energies for elemental P and Ag characteristic peaks and therefore, in a sample of unknown composition there is a risk that small concentrations of P or Ag could be identified erroneously. FIG. 1c shows the application of the pile-up correction Algorithm 1 which removes these sum peaks so that the corrected spectrum of FIG. 1c does not give rise to any false elemental identifications.
Although the method works well at low count rates, as the count rate is increased it is more likely that pile-up will occur with more than one pulse. That is, the probability increases that there is a pile up of three pulses. Extending the principle of the method of Algorithm 1, the magnitude of sum peaks involving unresolved pile-up of one pulse with two (not one) following pulses can be estimated with the approach shown in Algorithm 2 below:
Algorithm 2: A possible double pulse “pile-up correction”  1.Increase count magnitude in each spectrum channel a[i] tocompensate for lost counts:al[i] = a[i] * l(i)  2.For each channel i  For each channel j    For each channel k      Add al[i] * (al[j] / L) * T(i,j) * (a[k] / L) * T(j,k)into channel sp[i+j+k]
It should be noted that this is an extension of the method of Algorithm 1 and therefore the full correction in this case uses a consideration of single pulse pile-up as in Algorithm 1 in addition to double pulse pile-up as in Algorithm 2. However, in practice this causes a computational problem. If the spectrum consists of 1000 channels, then the nested loops required for the calculation in Algorithm 2 require a factor of 1000 times as many operations as the single pile-up calculation of Algorithm 1. Consequently, whereas correction for single pulse pile-up by the prior art approach can often be achieved in reasonable calculation times, correction for double pulse pile-up by a similar approach may be impractical. Indeed the users of such spectrum analysis apparatus are used to “real-time” correction of spectra, by which we mean that the calculations must be performed in less than 1 second.
One problem with Algorithm 1 is that pile-up losses and the contribution to sum events can only be calculated accurately if the input spectrum is known. Hence there is inherent inaccuracy because the measured spectrum is already subject to pile-up effects. As a result, the difference between the form of the acquired spectrum and the “true” spectrum becomes increasingly pronounced at higher count rates. As has been explained, pile-up losses occur in the spectrum when the photons involved in a pile-up event are not permitted to contribute to their true channel energy. The effect of pile-up losses can be compensated by a “boost” at the respective energy which is set out in step (1) of Algorithm 1. However, when sum peaks become significant, the procedure of Algorithm 1 cannot distinguish them from true elemental peaks and in practice this leads to “over-stripping” in the energy positions corresponding to double pile-up events. This effect is shown in FIGS. 2a and 2b where the spectrum input is essentially the same as for FIGS. 1a, 1b and 1c, but the intensity has been increased so that the count rate is high and is therefore high enough to produce much larger single pile-up sum peaks at Al+O and Al+Al. The uncorrected spectrum of FIG. 2a has a full scale ordinate of 10323 counts. Significant pile-up peaks of “Al+O” and “Al+Al” are illustrated. It is also possible to see smaller peaks at about 3.5 keV (corresponding to Al+Al+O) and about 4.5 keV (corresponding to (Al+Al+Al) which are caused by a double pile-up.
When the procedure of Algorithm 1 is applied, the large sum peaks (Al+O and Al+Al) are corrected quite well, however, over-stripping occurs at the energies corresponding to double pile-up, Al+Al+O and Al+Al+Al, because the calculation treats the Al+O and Al+Al sum peaks as if they were a real spectrum input. The effect of this over-stripping is noticeable as a reduction in local intensity for the respective energies, below the background level. So the over-stripping of pile-up sum contributions produces unrealistic “dips” or negative peaks in the spectrum, reduces the apparent continuum background level and causes errors in identifying element characteristic emission peaks.
A further problem for this single pile-up correction method arises when the beam is scanned over a grid of pixels to obtain a spectrum at each pixel, sometimes referred to as a “spectrum image”. A typical spectrum image may contain data from a 256×256 grid with 65536 pixels and it is often too time-consuming to apply the software correction at every pixel. Furthermore, a single pixel spectrum may not contain many counts, particularly if resolutions higher than 256×256 are used, and therefore statistical fluctuations can give rise to poor precision in the results of Algorithm 1. It is standard practice to display a single spectrum which sums the spectrum content from all pixels of a spectrum image (often known as the “sum spectrum”) and this aggregate spectrum is usually visually inspected, or processed by an algorithm, to find the peaks and determine what elements are present in the sample. If the pile-up correction of Algorithm 1 is applied to the sum spectrum, the results will be inaccurate if there is any variation in spectra across the field of view.
FIG. 3 shows a field of interest for a typical sample consisting of many different minerals. Thus, the spectral response is significantly different in different regions of this field of view. FIG. 4a shows that the sum spectrum for this field of pixels exhibits pile-up artifacts. FIG. 4b illustrates the effect of the pile-up correction Algorithm 1 on the spectrum of FIG. 4a. The upper curve represents the recorded spectrum whereas the lower curve shows the spectrum as corrected for pile-up. The pile-up correction is ineffective and produces anomalous results such as negative peaks or under-correction of sum peaks. For example in FIG. 4b a small sum peak is present at 8.2 keV but the correction algorithm overestimates this contribution and produces an unrealistic dip in the result spectrum at this energy. The inaccuracy is primarily due to the differences in spectral contributions from the various elements in different regions of the field of view from which the sum spectrum is created.
The key assumption for the prior art correction method of Algorithm 1 is that the measured spectrum can be used to predict the count rate for any x-ray energy and this count rate remains constant throughout the acquisition period. Clearly this does not apply when the spectrum is an aggregate of different spectra acquired from different regions. Furthermore the assumption does not apply if the count rates are so high that unresolved pile-up with two or more pulses becomes significant. There is therefore a need for an improved approach to spectrum correction for pile-up that addresses the problems exemplified by FIGS. 2a and 4b but does not involve a major increase in computational load.